#include "TestWindow.h"
#include "TabControl.h"
#include "../gui/Icons.h"


namespace Impp {

TestWindow::TestWindow() :
	wxFrame(NULL, wxID_ANY, _T("ChatWindow")) {
	Icons::init();
	SetSize(wxSize(500, 300));
	wxBoxSizer* sizer = new wxBoxSizer(wxVERTICAL);
	TabControl* control = new TabControl(this, wxID_ANY);
	log = new wxHtmlWindow(this,wxID_ANY);
	sizer->Add(control, 0, wxEXPAND);
	sizer->Add(log, 1, wxEXPAND);
	SetSizer(sizer);
	Layout();

	Connect(EVT_TAB_CHANGED, TabChangedEventHandler(TestWindow::onTabChanged));

	
	
	

}

TestWindow::~TestWindow() {
}

void TestWindow::onTabChanged(TabChangedEvent & event) {
	wxString text= wxT("<html><body>");
	text << wxT("Tab: ") << event.getNewTab()->getTitle();
	text << wxT("</html></body>");

	log->SetPage(text);

}

}
